{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# Regressão Linear Simples - Trabalho\n",
    "\n",
    "## Estudo de caso: Seguro de automóvel sueco\n",
    "\n",
    "Agora, sabemos como implementar um modelo de regressão linear simples. Vamos aplicá-lo ao conjunto de dados do seguro de automóveis sueco. Esta seção assume que você baixou o conjunto de dados para o arquivo insurance.csv, o qual está disponível no notebook respectivo.\n",
    "\n",
    "O conjunto de dados envolve a previsão do pagamento total de todas as reclamações em milhares de Kronor sueco, dado o número total de reclamações. É um dataset composto por 63 observações com 1 variável de entrada e 1 variável de saída. Os nomes das variáveis são os seguintes:\n",
    "\n",
    "1. Número de reivindicações.\n",
    "2. Pagamento total para todas as reclamações em milhares de Kronor sueco.\n",
    "\n",
    "Voce deve adicionar algumas funções acessórias à regressão linear simples. Especificamente, uma função para carregar o arquivo CSV chamado *load_csv ()*, uma função para converter um conjunto de dados carregado para números chamado *str_column_to_float ()*, uma função para avaliar um algoritmo usando um conjunto de treino e teste chamado *split_train_split ()*, a função para calcular RMSE chamado *rmse_metric ()* e uma função para avaliar um algoritmo chamado *evaluate_algorithm()*.\n",
    "\n",
    "Utilize um conjunto de dados de treinamento de 60% dos dados para preparar o modelo. As previsões devem ser feitas nos restantes 40%. \n",
    "\n",
    "Compare a performabce do seu algoritmo com o algoritmo baseline, o qual utiliza a média dos pagamentos realizados para realizar a predição ( a média é 72,251 mil Kronor).\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 79,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "#does both load_csv() and str_column_to_float()\n",
    "def load_csv(file):\n",
    "    x = []\n",
    "    y = []\n",
    "    for line in file:\n",
    "        x.append(float(line.split(',')[0]))\n",
    "        y.append(float(line.split(',')[1]))\n",
    "    return x, y"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 80,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "x, y = load_csv(open('insurance.csv'))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 81,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "dataset = []\n",
    "for i in range(len(x)):\n",
    "    dataset.append([x[i], y[i]])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 82,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def mean(values):\n",
    "    return sum(values) / float(len(values))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 83,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def variance(values, mean):\n",
    "    return sum([(x-mean)**2 for x in values])"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 84,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def covariance(x, mean_x, y, mean_y):\n",
    "    covar = 0.0\n",
    "    for i in range(len(x)):\n",
    "        covar += (x[i] - mean_x) * (y[i] - mean_y)\n",
    "    return covar"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 85,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def coefficients(dataset):\n",
    "    x = [row[0] for row in dataset]\n",
    "    y = [row[1] for row in dataset]\n",
    "    x_mean, y_mean = mean(x), mean(y)\n",
    "    b1 = covariance(x, x_mean, y, y_mean) / variance(x, x_mean)\n",
    "    b0 = y_mean - b1 * x_mean\n",
    "    return [b0, b1]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 86,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "import random\n",
    "def split_train_test(dataset, splitRatio):\n",
    "    trainSize = int(len(dataset) * splitRatio)\n",
    "    trainSet = []\n",
    "    copy = list(dataset)\n",
    "    while len(trainSet) < trainSize:\n",
    "        index = random.randrange(len(copy))\n",
    "        trainSet.append(copy.pop(index))\n",
    "    return [trainSet, copy]\n",
    "        \n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 87,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "train_set, test_set = split_train_test(dataset, 0.6)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 88,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "from math import sqrt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 89,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def rmse_metric(actual, predicted):\n",
    "    sum_error = 0.0\n",
    "    for i in range(len(actual)):\n",
    "        prediction_error = predicted[i] - actual[i]\n",
    "        sum_error += (prediction_error ** 2)\n",
    "    mean_error = sum_error / float(len(actual))\n",
    "    return sqrt(mean_error)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 90,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def simple_linear_regression(train, test):\n",
    "    predictions = list()\n",
    "    b0, b1 = coefficients(train)\n",
    "    for row in test:\n",
    "        ypred = b0 + b1 * row[0]\n",
    "        predictions.append(ypred)\n",
    "    return predictions"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 96,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": [
    "def evaluate_algorithm(dataset, algorithm):\n",
    "    test_set = list()\n",
    "    for row in dataset:\n",
    "        row_copy = list(row)\n",
    "        row_copy[-1] = None\n",
    "        test_set.append(row_copy)\n",
    "    predicted = algorithm(dataset, test_set)\n",
    "    print(predicted)\n",
    "    actual = [row[-1] for row in dataset]\n",
    "    rmse = rmse_metric(actual, predicted)\n",
    "    return predicted, rmse"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 97,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[388.68743024628236, 84.85713340037577, 64.37419203997757, 443.30860720734427, 156.54742816176946, 214.5824286828977, 98.51242764064123, 67.78801560004393, 173.6165459621013, 54.13272135977847, 37.06360355944664, 183.8580166423004, 57.54654491984484, 98.51242764064123, 43.89125067957937, 26.82213287924754, 101.92625120070761, 40.47742711951301, 30.23595643931391, 98.51242764064123, 40.47742711951301, 50.71889779971211, 50.71889779971211, 30.23595643931391, 118.99536900103944, 43.89125067957937, 33.64977999938027, 88.27095696044213, 43.89125067957937, 33.64977999938027, 19.99448575911481, 105.34007476077397, 40.47742711951301, 37.06360355944664, 95.09860408057487, 57.54654491984484, 228.23772292316318, 60.96036847991121, 33.64977999938027, 74.61566272017667, 64.37419203997757, 224.82389936309679, 159.96125172183582, 146.30595748157037, 207.75478156276498, 159.96125172183582, 57.54654491984484, 112.1677218809067, 47.30507423964574, 30.23595643931391, 78.02948628024305, 64.37419203997757, 64.37419203997757, 71.2018391601103, 47.30507423964574, 118.99536900103944, 122.4091925611058, 101.92625120070761, 50.71889779971211, 125.82301612117217, 67.78801560004393, 200.92713444263222, 108.75389832084034]\n"
     ]
    }
   ],
   "source": [
    "predictions, rmse = evaluate_algorithm(dataset, simple_linear_regression)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 98,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uIDIuMS4wLCBo\ndHRwOi8vbWF0cGxvdGxpYi5vcmcvpW3flQAAG9BJREFUeJzt3XuQHOV57/HvszurlbxKLFtIHF3Q\nrYyJ7I2DZEXoxFkXoPggMLHkxKRQDFYcLpXCJ7FwKrF8TEUmJBU7N+TUCfbhYkcOtmUfZAQxjhQM\ncqx/QNGFIGFZQQEvuplVZCDRGqSdnSd/dLcYVrMzPbs9M909v0+VSjM9vbNvz+w+8+7zvu/zmrsj\nIiL51dHqBoiISGMp0IuI5JwCvYhIzinQi4jknAK9iEjOKdCLiOScAr2ISM4p0IuI5JwCvYhIzhVa\n3QCA8847z+fNm9fqZoiIZMru3bv/w92n1TovFYF+3rx57Nq1q9XNEBHJFDPrj3OeUjciIjmnQC8i\n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32sTcjTyswmA5uBte7+n61uTz3M7GpgwN13\nlx+ucGqa348CsBj4grsvAgZJcZqmkjCPvRKYD8wEeghSHSOl+X2oJWs/V5jZpwlStF+NDlU4ranX\nkOVAH2sT8jQysy6CIP9Vd/9WePjF6E/S8P+BVrUvhvcAHzCzHxGkzC4n6OFPCVMIkP734whwxN2f\nDO8/QBD4s/Q+/ArwvLufcPch4FvAL5Gt9yEy2uueqd9zM1sDXA182F+fu97ya8hyoG/YJuSNFOay\n7wMOuPtflz30MLAmvL0GeKjZbYvL3T/l7rPdfR7B6/64u38Y2A58KDwt7dfwY+CwmV0UHloO/IAM\nvQ8EKZtlZvam8OcquobMvA9lRnvdHwY+Es6+WQa8EqV40sbMVgCfBD7g7j8te+hh4Foz6zaz+QQD\nyzub2jh3z+w/4CqC0e1/Bz7d6vbEbPMvE/zZ9jTwVPjvKoIc92PAs+H/b211W2Nez6XAt8PbCwh+\ngA8B/x/obnX7arT9YmBX+F5sAd6StfcBuB34IbAf+HugO+3vA/B1gjGFIYLe7g2jve4EaY+/DX/H\n9xHMMErrNRwiyMVHv9dfLDv/0+E1HASubHZ7tTJWRCTnspy6ERGRGBToRURyToFeRCTnFOhFRHJO\ngV5EJOcU6EVEck6BXkQk5xToRURy7r8BNv/KnM+uZKsAAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6b1d04ac50>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "\n",
    "plt.scatter(x, y, alpha = 1, s = 100)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 102,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD8CAYAAAB5Pm/hAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAADl0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uI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P3eiwx6Xx3/jzxCdYZTWfagjOhbf8Hd9\nZaPtx8X78CIwrNz96p2xIiIZV8mHbkREpAAKehGRjFPQi4hknIJeRCTjFPQiIhmnoBcRyTgFvYhI\nxinoRUQy7v8B8zYsxhou8p4AAAAASUVORK5CYII=\n",
      "text/plain": [
       "<matplotlib.figure.Figure at 0x7f6b1cf84588>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "plt.plot(x, predictions)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 100,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "35.365829968791466\n"
     ]
    }
   ],
   "source": [
    "print(rmse)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": true
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.5.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
